import { stringify } from 'qs';
import {request} from '../utils/request';
import { getConfig } from '../../config';
const config = getConfig();

// 当前告警信息列表--------------------------------------------------------------------
export async function queryWarnList(params) {
  return request('/warn/warninfo/queryCurList', {
    method: 'POST',
    body: params,
  });
}


// 历史告警信息列表
export async function queryHistoryWarnList(params) {
  return request('/warn/warninfo/queryHisList', {
    method: 'POST',
    body: params,
  });
}


// // 关联的历史告警记录
// export async function queryDependentHistoryWarnList(params) {
//   return request('03010002', {
//     method: 'POST',
//     body: params,
//   });
// }



// 获取告警信息详情
export async function queryWarnInfo(params) {
  if (config.isMock) {
    return request(`/warn/warninfo/info`, {
      method: 'POST',
      body: params,
    });
  }else{
    return request(`/warn/warninfo/info/${params.warnId}`, {
      method: 'POST',
    });
  }
}

// 关闭告警
export async function actionWarnClose(params) {
  return request('/warn/warninfo/closeWarn', {
    method: 'POST',
    body: params,
  });
}

// 告警信息批量导出
export async function actionWarnExport(params) {
  return request(
    "03010006",
    {
      method: "POST",
      body: params
    },
    null,
    null,
    "download"
  );
}





